/* SI-tables.do
# Philips, Andrew Q. "How to Avoid Incorrect Inference (While Gaining Correct Ones) in Dynamic Models". Forthcoming at Political Science Research and Methods. 
# andrew.philips@colorado.edu
# 2/9/21
#
# Tables produced in this R script:
#   --SI, Table 1
#	--SI, Table 2
# ----------------------------------- */
clear
set seed 29209
set obs 100
gen t = _n
tsset t
gen x = rnormal()
replace x =  rnormal() in 2/100
gen y = rnormal()
replace y = 0.8*l.y + 0*x + 3*l.x + rnormal() in 2/100

* SI, Table 1
reg y l.y x l.x
est sto e1
estout e1, style(tex) cells(b(star fmt(2)) se(par fmt(2))) // Table 1
nlcom (_b[x] + _b[l.x])/(1-_b[l.y]) // calculated LR effect

* SI, Table 2
reg d.y l.y d.x l.x
est sto e2, 
estout e2, style(tex) cells(b(star fmt(2)) se(par fmt(2))) // Table 2
nlcom ( _b[l.x])/(-_b[l.y]) // calculated LR effect

